package com.jiyun.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jiyun.mapper.OrderMapper;
import com.jiyun.pojo.Order;
import com.jiyun.service.OrderSerevice;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderSerevice {

    @Resource
    private OrderMapper orderMapper;

    @Override
    public PageInfo<Order> list(Integer current, Integer pageSize) {

        PageHelper.startPage(current, pageSize);

        List<Order> list = orderMapper.list();

        PageInfo<Order> orderPageInfo = new PageInfo<>(list);

        return orderPageInfo;
    }

    @Override
    public int add(Order order) {
        return orderMapper.add(order);
    }

    @Override
    public Order blur(String htbh) {
        return orderMapper.blur(htbh);
    }
}
